#include <iostream>
#include <vector>

using namespace std;

int ex[100001];
vector<int> w;

int main()
{
    int n;
    cin>>n;
    for(int i=0;i<n;i++)
    {
        int wi;
        cin>>wi;
        int s = w.size();
        for(int j=0;j<s;j++)
        {
            int temp1 = abs(w[j] + wi);
            int temp2 = abs(w[j] - wi);
            if(ex[temp1]==0){w.push_back(temp1);ex[temp1]=1;}
            if(ex[temp2]==0){w.push_back(temp2);ex[temp2]=1;}
        }
        if(ex[wi]==0){w.push_back(wi);ex[wi]=1;}
    }
    cout<<w.size();
    return 0;
}
